﻿Public Class CityFillUtilites



    'Public Shared Sub fillCities(ByVal Dict As Dictionary(Of String, String))
    '    For Each cityID In Dict.Values
    '        fillcity(cityID)
    '    Next
    'End Sub




    'Public Shared Sub fillcity(ByVal singleCityID As String)
    '    loopSendResourceQuery(Form1.getCityClass(singleCityID))
    'End Sub

    ' ''' <summary>
    ' ''' This Function starts a thread to purify resources in the negetive direction. It will not fill up resources
    ' ''' </summary>
    ' ''' <param name="numOfResources">The number of resources you want to purify</param>
    ' ''' <remarks></remarks>
    'Public Shared Sub startResourceQuery(ByVal singleCityID As String)
    '    loopSendResourceQuery(CInt(Form1.TextBoxResources.Text), singleCityID)
    'End Sub

    ' ''' <summary>
    ' ''' The Function that will be threaded. It loops through and purifies till the number of purified resources is met.
    ' ''' </summary>
    ' ''' <remarks></remarks>
    'Private Shared Sub loopSendResourceQuery(ByVal resouceToPurify As Integer, ByVal singleCityID As String)
    '    Dim i As Integer = 0
    '    Dim validRequest As Boolean = True
    '    Dim query As String
    '    Dim request As RequestSender

    '    While i < resouceToPurify And validRequest
    '        query = RequestBuilder.createContent(singleCityID, Form1.TextBoxSessionID.Text, Form1.CheckBoxWood.Checked, Form1.CheckBoxStone.Checked, Form1.CheckBoxIron.Checked, Form1.CheckBoxWheat.Checked)
    '        request = New RequestSender(Form1.purifyHTTP, Form1.Server, Form1.World)
    '        validRequest = Convert.ToBoolean(request.sendReserachRequest(query))
    '        i = i + 1
    '    End While
    'End Sub

    ' ''' <summary>
    ' ''' Overloaded function. If you call this one pass a city object so it can fill up the city with resources.
    ' ''' </summary>
    ' ''' <param name="city"></param>
    ' ''' <remarks></remarks>
    'Private Shared Sub loopSendResourceQuery(ByVal city As CityClass)
    '    Dim resouceToPurify As Integer
    '    Dim i As Integer = 0
    '    Dim validRequest As Boolean = True
    '    Dim query As String
    '    Dim request As RequestSender
    '    resouceToPurify = city.getMaxResourcesNeeded()

    '    While i < CDec(resouceToPurify) And validRequest
    '        query = RequestBuilder.createContent(Form1.TextBoxSessionID.Text, city)
    '        request = New RequestSender(Form1.purifyHTTP, Form1.Server, Form1.World)
    '        validRequest = Convert.ToBoolean(request.sendReserachRequest(query))
    '        i = i + 1
    '    End While
    'End Sub

End Class
